package com.gufe.mapper.admin.mmp;


import com.gufe.entity.MilitaryInfo;
import com.gufe.entity.MilitaryShow;
import com.gufe.vo.MilitaryShowVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MilitaryTrainMapper {
    // 获取所有军训展示信息
    @Select("select * from military_show")
    List<MilitaryShowVO> getTrainInfo();

    // 新增军训展示信息
    @Insert("insert into military_show (title, content, img_url, video_url) " +
            "VALUES (#{title},#{content},#{imgUrl},#{videoUrl}) ")
    void addTrainInfo(MilitaryShow militaryShow);

    // 更新军训展示信息
    @Update("update military_show set content = #{content},title = #{title},img_url = #{imgUrl}," +
            "video_url = #{videoUrl} where id = #{id}")
    void updateTrainInfo(MilitaryShow militaryShow);

    // 根据ID删除军事训练展示信息
    @Delete("delete from military_show where id = #{id}")
    void deleteTrainInfo(Integer id);


    // 根据ID获取军事训练展示信息
    @Select("select * from military_show where id = #{id}")
    MilitaryShow getInfoById(Integer id);
}
